package com.mz.ozy.adapter;

import android.text.TextUtils;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mz.ozy.R;
import com.mz.ozy.bean.MallBean;
import com.mz.ozy.bean.MyIntegralBean;
import com.mz.ozy.utils.glideUtils.GlideUtils;

import java.util.List;

/**
 * Created by administrator on 2018/11/21.
 */
public class HotTopicAdapter extends BaseQuickAdapter<MyIntegralBean.TopicListBean, BaseViewHolder> {


    public HotTopicAdapter(@Nullable List<MyIntegralBean.TopicListBean> data) {
        super(R.layout.item_hot_topic, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MyIntegralBean.TopicListBean item) {
        helper.setText(R.id.tv_topic_name, item.getTitle());
        final ImageView ivGoodsBanner = helper.getView(R.id.iv_goods_banner);
        GlideUtils.loadRoundImg(mContext, ivGoodsBanner, item.getImg(), R.mipmap.default_main_banner, 4);
        if (helper.getAdapterPosition() == getData().size() - 1) {
            helper.setGone(R.id.view_topic_divider, false);
        } else {
            helper.setVisible(R.id.view_topic_divider, true);
        }
    }
}
